#include "finalnode.h"
#include <QPainter>

FinalNodeShape *FinalNodeShape::clone() const
{
	FinalNodeShape *newshape = new FinalNodeShape();
	newshape->setPos(this->pos());
	return newshape;
}

FinalNodeShape::FinalNodeShape (QGraphicsItem *parent)
	: Shape(parent)
	, InitialNodeShape(parent)
{
}

FinalNodeShape::FinalNodeShape (const QPointF &pos, QGraphicsItem *parent)
	: Shape(parent)
	, InitialNodeShape(pos, parent)
{
}

void FinalNodeShape::paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
	painter->setBrush(Qt::white);
	painter->setPen(Qt::black);
	painter->drawEllipse(QPoint(0,0), RADIUS,RADIUS);
	painter->setBrush(Qt::black);
	painter->drawEllipse(QPoint(0,0), RADIUS-5,RADIUS-5);

	if (isSelected())
	{
		setPenAndBrushForSelection(painter);
		painter->drawEllipse(QPoint(0,0), RADIUS-2,RADIUS-2);
	}
}
